package com.yilin.medical.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.yilin.medical.R;
import com.yilin.medical.model.YiYuanDetailsBean;

public class YiYuanDetailsAdapter extends BaseAdapter {
	private List<YiYuanDetailsBean> list = null;
	private Context mContext;
	
	public YiYuanDetailsAdapter(Context mContext, List<YiYuanDetailsBean> list) {
		this.mContext = mContext;
		this.list = list;
	}
	

	public int getCount() {
		return this.list.size();
	}

	public Object getItem(int position) {
		return list.get(position);
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(final int position, View view, ViewGroup arg2) {
		ViewHolder holder = null;
		final YiYuanDetailsBean mContent = list.get(position);
		if (view == null) {
			holder = new ViewHolder();
			view = LayoutInflater.from(mContext).inflate(R.layout.listitem_yiyuandetails, null);
			holder.tv_title = (TextView) view.findViewById(R.id.title);
			
			holder.tv_keshi = (TextView) view.findViewById(R.id.tv_keshi);
			holder.tv_zhiwei = (TextView) view.findViewById(R.id.tv_zhiwei);
			holder.tv_hospitalname = (TextView) view.findViewById(R.id.tv_hospitalname);
			holder.tv_describe = (TextView) view.findViewById(R.id.tv_describe);
			holder.iv = (ImageView) view.findViewById(R.id.iv);
			view.setTag(holder);
		} else {
			holder = (ViewHolder) view.getTag();
		}
		
	
//		holder.tv_title.setText(this.list.get(position).getName());
		
		return view;

	}
	


	final static class ViewHolder {
		TextView  tv_title, tv_keshi, tv_zhiwei, tv_hospitalname,
				tv_describe;
		ImageView iv;
	}

	
}